from common.db_util import DBUtil
from common.token_util import TokenUtil
import requests

class EmpIdUtil:
  tel="13748374839"
  def setup(self):
    del_sql=f"delete from bs_user where mobile='{self.tel}';"
    DBUtil.uid_db(del_sql)
  @classmethod
  def get_emp_id(cls):
    token=TokenUtil.get_token()
    url="http://ihrm2-test.itheima.net/api/sys/user"
    header={"Content-Type":"application/json", "Authorization":token}
    body={
    "username": "小猪佩奇",
    "mobile":cls.tel,
    "workNumber": "22"}
    resp=requests.post(url=url,headers=header,json=body)
    print(resp.json())
    # emp_id=resp.json().get("data").get("id")
    # return emp_id
if __name__ == '__main__':
  print(EmpIdUtil.get_emp_id())


